package com.lai.shop.controller;

import com.lai.shop.service.OrderService;
import com.lai.shop.vo.OrderDetailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

@Controller
public class OrderWebController {


    @Autowired
    OrderService orderService;


    @GetMapping("/submitOrder")
    public String submitOrder(Model model, HttpSession session){
        OrderDetailVo orderDetailVo = orderService.submitOrder(session);
        model.addAttribute("orderDetail",orderDetailVo);
        return "order";
    }


}
